package com.ywj.activemq3PC;

import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Queue;

@Component
public class Producer {
    @Resource
    private JmsMessagingTemplate jmsMessagingTemplate;
    @Resource
    private Queue queue;
    public void sendMsg(String msg) {
        System.out.println("生产者发送消息内容 :" + msg);
        this.jmsMessagingTemplate.convertAndSend("yuwenjie.queue", msg);
    }
}
